<?php

use yii\db\Migration;

/**
 * Handles the creation of table `{{%contact_project}}`.
 */
class m240307_074458_create_contact_project_table extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->createTable('{{%contact_project}}', [
            'id' => $this->primaryKey(),

            'contactId' => $this->integer()->notNull(),
            'projectId' => $this->integer()->notNull(),

            'createdAt' => $this->datetime()->defaultExpression('CURRENT_TIMESTAMP'),
            'updatedAt' => $this->datetime()->defaultExpression('CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP'),
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable('{{%contact_project}}');
    }
}
